package com.lcredu.jdbctemplate.dao;

import com.lcredu.bean.Monster;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @author 黎长容
 * @date 2025-07-17 16:58
 */
@Repository
public class MonsterDao {
    @Resource
    private JdbcTemplate jdbcTemplate;

    public void save(Monster monster) {
        String sql = "insert into monster values (?,?,?);";
        jdbcTemplate.update(sql, monster.getMonsterId(), monster.getName(), monster.getSkill());
    }
}
